package com.appwoo.txtws.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.appwoo.txtws.bean.Record_SoftBean;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class BlackListGameAdapter extends ArrayAdapter<Record_SoftBean>
{
  private boolean show = false;
  private Map<Integer, View> viewMap = new HashMap();

  public BlackListGameAdapter(Activity paramActivity, List<Record_SoftBean> paramList)
  {
    super(paramActivity, 0, paramList);
  }

  public List<Record_SoftBean> getDeleteList()
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator;
    if ((this.viewMap != null) && (this.viewMap.size() > 0))
      localIterator = this.viewMap.keySet().iterator();
    while (true)
    {
      if (!localIterator.hasNext())
        return localArrayList;
      int i = ((Integer)localIterator.next()).intValue();
      Record_SoftBean localRecord_SoftBean = (Record_SoftBean)getItem(i);
      if (((CheckBox)((View)this.viewMap.get(Integer.valueOf(i))).findViewById(2131493174)).isChecked())
        localArrayList.add(localRecord_SoftBean);
    }
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    View localView = (View)this.viewMap.get(Integer.valueOf(paramInt));
    if (localView == null)
    {
      localView = ((Activity)getContext()).getLayoutInflater().inflate(2130903127, null);
      Record_SoftBean localRecord_SoftBean = (Record_SoftBean)getItem(paramInt);
      ((TextView)localView.findViewById(2131493175)).setText(localRecord_SoftBean.getType());
      ((TextView)localView.findViewById(2131493176)).setText(localRecord_SoftBean.getGameName());
      if (paramInt % 2 == 0)
        ((LinearLayout)localView.findViewById(2131493173)).setBackgroundResource(2130837719);
      this.viewMap.put(Integer.valueOf(paramInt), localView);
      ((CheckBox)localView.findViewById(2131493174)).setVisibility(0);
    }
    return localView;
  }

  public void hiddenImageView()
  {
    this.show = true;
    Iterator localIterator;
    if ((this.viewMap != null) && (this.viewMap.size() > 0))
      localIterator = this.viewMap.values().iterator();
    while (true)
    {
      if (!localIterator.hasNext())
        return;
      ((CheckBox)((View)localIterator.next()).findViewById(2131493174)).setVisibility(8);
    }
  }

  public void showChoseImageView(boolean paramBoolean)
  {
    this.show = true;
    Iterator localIterator;
    if ((this.viewMap != null) && (this.viewMap.size() > 0))
      localIterator = this.viewMap.values().iterator();
    while (true)
    {
      if (!localIterator.hasNext())
        return;
      CheckBox localCheckBox = (CheckBox)((View)localIterator.next()).findViewById(2131493174);
      localCheckBox.setVisibility(0);
      if (paramBoolean)
        localCheckBox.setChecked(true);
      else
        localCheckBox.setChecked(false);
    }
  }

  public void showImageView()
  {
    this.show = true;
    Iterator localIterator;
    if ((this.viewMap != null) && (this.viewMap.size() > 0))
      localIterator = this.viewMap.values().iterator();
    while (true)
    {
      if (!localIterator.hasNext())
        return;
      ((CheckBox)((View)localIterator.next()).findViewById(2131493174)).setVisibility(0);
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.adapter.BlackListGameAdapter
 * JD-Core Version:    0.6.2
 */